package view;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import java.awt.Toolkit;

import javax.swing.JLabel;
import javax.swing.ImageIcon;

import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class About extends JDialog
{

	private static final long serialVersionUID = 1L;
	private final JPanel contentPanel = new JPanel();

	public About()
	{
		setTitle("Turing Machine Simulator - About");
		setIconImage(Toolkit.getDefaultToolkit().getImage("ico.jpg"));
		setBounds(100, 100, 450, 268);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		
		JLabel label = new JLabel("");
		label.setIcon(new ImageIcon("ico2.jpg"));
		label.setBounds(10, 11, 80, 81);
		contentPanel.add(label);
		
		JLabel lblTuringMachineSimulator = new JLabel("Turing Machine Simulator");
		lblTuringMachineSimulator.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblTuringMachineSimulator.setBounds(100, 33, 212, 33);
		contentPanel.add(lblTuringMachineSimulator);
		
		JLabel lblProjetoPropostoPelo = new JLabel("Project proposed by Professor Ronaldo Goldschmidt,");
		lblProjetoPropostoPelo.setBounds(79, 119, 313, 14);
		contentPanel.add(lblProjetoPropostoPelo);
		
		JLabel lblNaDisciplinaLinguagens = new JLabel("discipline: Formal Languages \u200B\u200Band Automata.");
		lblNaDisciplinaLinguagens.setBounds(99, 132, 272, 14);
		contentPanel.add(lblNaDisciplinaLinguagens);
		
		JLabel lblNewLabel = new JLabel("Developed by Geovani Silva Celebrim");
		lblNewLabel.setBounds(115, 172, 256, 14);
		contentPanel.add(lblNewLabel);
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton okButton = new JButton("OK");
				okButton.addActionListener(new ActionListener() {
					@SuppressWarnings("deprecation")
					public void actionPerformed(ActionEvent e) {
						hide();
					}
				});
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
		}
	}
}
